﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;
using Noea.HTTP;

namespace Noea.Parser
{
    // Crawler uses this class to traverse the site.

    public class HTMLDocSimple : IHTMLDoc
    {
        private string doc;
        private Uri uri;
        private Uri baseUri;
        private IList links;    // Every link is represented by an edge.
        private string url;
        private string document;

    /*    public HTMLDocSimple(string url)
        {
            this.url = url;
        }
        */
        public HTMLDocSimple(string baseUri)
        {
            // In future this could be null and will process cross-site, but for now must exist
            BaseUri = new Uri(uri.AbsolutePath); BaseUri.GetLeftPart(UriPartial.Authority); 
            
        }

    
        // read-only property. Returns the web page as a string.      
        public string Document
        {
            get { return document; }
        }

        // read-only. Returns the URL of the current web-page
        public string URL
        {
            get { return url; }
        }

        // Returns a list of strings containing the urls of all links to pages on the this site.
        // That is: links to web pages outside this are not included
        public IList GetAllLinks()
        {

            throw new NotImplementedException();
        }

        // returns true if searchString is found in <body>...</body> in this HTML-document
        public bool Contains(string searchString)
        {
            throw new NotImplementedException();
        }

        public Uri BaseUri
        {
            get { return baseUri; }
            set { baseUri = value; }
        }


        public string GetHref(string anchor)
        {
            throw new NotImplementedException();
        }

        public void GetFrames()
        {
            throw new NotImplementedException();
        }

        public string GetSrc(string anchor)
        {
            throw new NotImplementedException();
        }




    }
}